/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
 * Description: alg embedding service.
 * Author: qingjicheng
 * Create: 2023-2-23
 */

#ifndef ALG_EMBEDDING_SERVICE_H
#define ALG_EMBEDDING_SERVICE_H

#include "alg_base.h"

namespace hccl {
class AlgEmbeddingService : public AlgBase {
public:
    explicit AlgEmbeddingService() = default;
    virtual ~AlgEmbeddingService() = default;
protected:
    HcclResult AlgServiceCancel(HcclOperator<EmbeddingServiceParam> *opPtr);
    HcclResult PushSendSignalTask(u32 *signal, std::vector<u32> &destRanks,
        std::map<u32, DeviceMem> &transferMems, HcclOperator<EmbeddingServiceParam> *opPtr,
        OpTaskType sendType = OpTaskType::ISEND);
    HcclResult SendNoSignalTask(std::vector<u32> &destRanks, std::map<u32, std::vector<DeviceMem>> &transferMems,
        HcclOperator<EmbeddingServiceParam> *opPtr, OpTaskType sendType, void *responseValue);

private:
    u32 cancelSignal_ = SERVICE_CANCEL_SIGNAL;
};
} // namespace hccl
#endif